<template>
	<view class="u-padding-30">
		<view style="color: #3C97FF;margin-left: 10rpx;font-weight: bold;font-size: 34rpx;">问题类型</view>
		<u-collapse  @change="collapse('one',$event)">
			<u-collapse-item :title="item.classifyName" v-for="(item, index) in itemList" :key="index">
				<u-collapse :arrow="false"  @change="collapse('two',$event)">
					<u-collapse-item :title="item1.issue" v-for="(item1, index1) in item.child" :key="index1">
					</u-collapse-item>
				</u-collapse>
			</u-collapse-item>
		</u-collapse>
		
		
		<view style="color: #3C97FF;margin-left: 10rpx;font-weight: bold;font-size: 34rpx;">其他问题</view>
		
		
		
		<view v-for="(item,index) in list" :key="index" @click="go(item)">
			<u-cell-item  :title="item.title" :border-bottom="false"></u-cell-item>
		</view>
		
		
		
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				itemList: [],
				one:"",
				two:"",
				list:[]
			}
		},
		onLoad() {
			this.name()
			this.newsCate()
		},
		methods: {
			newsCate(){
				this.$u.post('/index/news', {
				}).then(res => {
				   this.list=res;
				}).catch(err => {
							
				})
			},
			

			go(item){
				uni.navigateTo({
					url:'/pages/about/index?id='+item.id
				})
			},
			name() {
				this.$u.post('/index/faq', {
				}).then(res => {
					this.itemList = res;
					resolve(res)
				}).catch(err => {
							
				})
			},
			collapse(e,$event){
				if(e=='one'){
					this.one=$event;
					return
				}
				if(e=='two'){
					this.two=$event
				}
		
				uni.navigateTo({
					url:'./detail?id='+this.itemList[this.one].child[this.two].id
				})
			}
		},
	}
</script>

<style>
	.u-cell{
		padding: 10rpx 10rpx!important;
	}
</style>
